io/ring.h: new macro to detect whether there are too many requests on the ring
authorJan Beulich <jbeulich@suse.com>
Wed, 12 Jun 2013 08:07:20 +0000 (10:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 12 Jun 2013 08:07:20 +0000 (10:07 +0200)
commita63c57093b610e8707653fb2320f48e2ad5acbc2
tree85320636940b2f9a98a90af08ccc3ab2f1c13913
parentf8e8fd56bd7d5675e8331b4ec74bae76c9dbf24e
io/ring.h: new macro to detect whether there are too many requests on the ring

Backends may need to protect themselves against an insane number of
produced requests stored by a frontend, in case they iterate over
requests until reaching the req_prod value. There can't be more
requests on the ring than the difference between produced requests
and produced (but possibly not yet published) responses.

This is a more strict alternative to a patch previously posted by
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/include/public/io/ring.h